1. Field of the Invention
The present invention relates to a video encoding apparatus, and more particularly, to a motion vector search apparatus and method suitably used for searching for motion vectors of macroblocks comprising an image of the video.
The present specification is based on a patent application filed in Japan (Japanese Patent Application No. 11-348159), and the contents described in said Japanese patent application are incorporated as a portion of the present specification.
2. Description of the Related Art
A broad range of video encoding technology, which is used to compress the amount of data of videos, has been used practically, ranging from that used for video telephones and teleconferencing, to that used for recording and accumulating digital videos. ITU-T H.261 and MPEG1, MPEG2 standards are among these video encoding technologies. They use the motion compensated prediction which encodes differences between a block of an image to be encoded and a reference block pointed by a motion vector.
A known example of a motion vector search apparatus of the prior art is the apparatus described in xe2x80x9cHistogram-Adaptive Motion Vector Searching and its Hardware Implementation in an MPEG-2 Encoding LSIxe2x80x9d in Shingaku Giho ICD97-163.
FIG. 9 is a block diagram showing the configuration of video encoding apparatus 20 that uses this motion vector search apparatus of the prior art. In this drawing, video encoding apparatus 20 is composed of CPU 1, inter-frame noise reduction filter (abbreviated as NR filter) 2, original image memory 3, macroblock encoding processing unit (abbreviated as MB encoding processing unit) 21, and frame memory 8. MB encoding processing unit 21 is composed of motion vector search unit 22 and encoding/post-processing unit 7.
Motion vector searching of the prior art is performed according to the processing described below by CPU 1, MB encoding processing unit 21 and frame memory 8.
To begin with, the output of NR filter 2 retained in frame memory 8 is input to motion vector search unit 22 as a current macroblock (16xc3x9716 pixels) of an image to be encoded. Next, a reference area of a reference image that is referred to when searching for motion vectors (to be referred to as the motion vector search area) is input from frame memory 8 to motion vector search unit 22. This reference image is xe2x80x9can image that was encoded and restored by encoding/post-processing unit 7 in order to provide prediction blocks. As a result of then comparing the input current macroblock and the reference area by motion vector search unit 22 and CPU 1, motion vector of the current macroblock is detected. Although the quality of encoded images can be improved with a wider motion vector search range, a huge amount of calculations are required. Consequently, various methods have been examined for searching for motion vectors that reduce the amount of calculations, and in this example of the prior art, this is performed by adaptively changing the size and location of the search area using the histogram of detected motion vectors of previously encoded images.
Furthermore, although the video encoding apparatus 20 of the prior art shown in the above-mentioned FIG. 9 employs a configuration wherein original image memory 3 and frame memory 8 are each provided separately, a configuration in which original image memory 3 and frame memory 8 are integrated into a single frame memory is normally performed in the prior art.
In the above-mentioned motion vector search apparatus of the prior art, the location and the shape of the motion vector search area is adaptively changed using the histogram of detected motion vectors of previously encoded images. The histogram refers to the motion vectors of the higher occurrences or the average of the motion vectors detected for each macroblock of the encoded image immediately before. Therefore, in the case of images in which motion is discontinuous with respect to previous images, such as momentary images at which motion just starts, or momentary images at which motion has just stopped, the motion vector search area determined on the basis of the histogram of previously detected motion vectors differs from actual motion of the encoded image. Thereby arises the problem that high accuracy motion vector searching is not always able to be attained. As a result, image quality degrades, and the quality of succeeding images using this degraded image as a reference image also end up deteriorating.
The object of the present invention is to provide a motion vector search apparatus and method that is able to set the motion vector search area that matches the actual motion of the current image, thereby allowing motion vector searching to be performed that demonstrates high accuracy at all times, even for images in which motion is discontinuous with respect to the previous images.
The present invention is equipped with a global motion vector search unit, which detects a global motion vector of a current input image over a predetermined range on a screen by evaluating differences between an input image one frame earlier and a current input image for said predetermined range; a motion vector search area determination unit, which sets the search areas of macroblock motion vectors that are motion vectors for each macroblock of an image to be encoded, based on said global motion vector; and, a motion vector search unit that determines said macroblock motion vectors by comparing each macroblock of the image to be encoded with said search areas of a reference image.
In addition, the present invention is equipped with a global motion vector search unit, which detects a global motion vector of a predetermined range on a screen by evaluating differences between an input image one frame earlier and a current input image for said predetermined range; a motion vector search area determination unit, which sets the search areas of macroblock motion vectors that are motion vectors for each macroblock, based on said global motion vectors that have been determined for each of a plurality of input images in the case a plurality of images are present between the image to be encoded and a reference image that is referred to during encoding said image to be encoded; and, a motion vector search unit that determines said macroblock motion vectors by comparing each macroblock of said image to be encoded with said search areas of said reference image.
Preferably, said global motion vector search unit determines said global motion vector by evaluating the differences between a portion of said input image one frame earlier and a portion of said current input image. Both portions of those images can be decimated.
In addition, said motion vector search area determination unit preferably sets one or both of the center and shape of said search area based on results of searching said global motion vector.
In addition, the present invention is preferably additionally equipped with an inter-frame noise reduction filter that attenuates noise contained in said input image before said input image is input to said global motion vector search unit.
In addition, the present invention detects said global motion vector by evaluating differences between an input image one frame earlier and a current input image for said predetermined range; setting the search areas of macroblock motion vectors, based on said global motion vector; and, comparing each macroblock of said image to be encoded with said search areas of said reference image.
In addition, the present invention detects said global motion vector by evaluating differences between an input image one frame earlier and a current input image for said predetermined range; setting the search areas of macroblock motion vectors, based on said global motion vectors that have been determined for each of a plurality of input images in the case a plurality of frames are present between said image to be encoded and a reference image that is referred to during encoding said image to be encoded; and, comparing each macroblock of said image to be encoded with said search areas of said reference image.
According to the present invention, a motion vector search area can be determined that matches the actual motion of the image to be encoded, and highly accurate motion vector searching can be performed at all times even for images in which motion is discontinuous with respect to the encoded image immediately before.
Moreover, since said global motion vector search unit determines said global motion vector by evaluating differences between a portion of said input image one frame earlier and a portion of said current input image and both portions of these images can be decimated, the amount of calculations and the amount of data transfer for searching for a global motion vector can be reduced.
Moreover, since images referred to by an inter-frame noise reduction filter are used as input images of the previous frame referred to in global motion vector searching, it is not necessary to provide additional frame memory for retaining image data of the previous frame, and not necessary to transfer additional data for global motion vector searching.
Furthermore, since this summary of the present invention does not list all necessary characteristics, sub-combinations of this group of characteristics are also included in the present invention.